from django.shortcuts import render
from datetime import datetime
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.urls import reverse
from student.models import Student

# 首页
def index(request):
    if request.session.get('is_login',None):  #若session认证为真
        username = request.session.get('username',None)
        student = Student.objects.get(student_id=username)
        return render(request, 'index.html', {'student': student, })
    else:
        return render(request, 'index.html')



